/*  1:   */ package org.jetbrains.generate.tostring;
/*  2:   */ 
/*  3:   */

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.Project;
import org.jetbrains.generate.tostring.config.Config;
import org.jetbrains.generate.tostring.view.ConfigUI;

import javax.swing.*;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */ 
/* 11:   */ public class GenerateToStringConfigurable
/* 12:   */   implements Configurable
/* 13:   */ {
/* 14:31 */   private static final Logger a = Logger.getInstance("#org.jetbrains.generate.tostring.GenerateToStringConfigurable");
/* 15:   */   private ConfigUI b;
/* 16:   */   private final Project c;
/* 17:   */   
/* 18:   */   public GenerateToStringConfigurable(Project paramProject)
/* 19:   */   {
/* 20:37 */     this.c = paramProject;
/* 21:   */   }
/* 22:   */   
/* 23:   */   public String getDisplayName()
/* 24:   */   {
/* 25:41 */     return "Settings";
/* 26:   */   }
/* 27:   */   
/* 28:   */   public String getHelpTopic()
/* 29:   */   {
/* 30:45 */     return null;
/* 31:   */   }
/* 32:   */   
/* 33:   */   public JComponent createComponent()
/* 34:   */   {
/* 35:49 */     return this.b = new ConfigUI(GenerateToStringContext.getConfig(), this.c);
/* 36:   */   }
/* 37:   */   
/* 38:   */   public boolean isModified()
/* 39:   */   {
/* 40:53 */     return !GenerateToStringContext.getConfig().equals(this.b.getConfig());
/* 41:   */   }
/* 42:   */   
/* 43:   */   public void apply()
/* 44:   */     throws ConfigurationException
/* 45:   */   {
/* 46:57 */     Config localConfig = this.b.getConfig();
/* 47:58 */     GenerateToStringContext.setConfig(localConfig);
/* 48:60 */     if (a.isDebugEnabled()) {
/* 49:60 */       a.debug("Config updated:\n" + localConfig);
/* 50:   */     }
/* 51:   */   }
/* 52:   */   
/* 53:   */   public void reset()
/* 54:   */   {
/* 55:64 */     this.b.setConfig(GenerateToStringContext.getConfig());
/* 56:   */   }
/* 57:   */   
/* 58:   */   public void disposeUIResources()
/* 59:   */   {
/* 60:68 */     this.b = null;
/* 61:   */   }
/* 62:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.generate.tostring.GenerateToStringConfigurable

 * JD-Core Version:    0.7.0.1

 */